package com.hmtech.ayp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmtech.ayp.domain.entity.StyleCategory;
import com.hmtech.ayp.enums.CommonState;
import com.hmtech.ayp.enums.DeletedFlag;
import com.hmtech.ayp.mapper.StyleCategoryMapper;
import com.hmtech.ayp.service.IStyleCategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class StyleCategoryServiceImpl extends ServiceImpl<StyleCategoryMapper, StyleCategory>
        implements IStyleCategoryService {
    @Override
    public List<StyleCategory> listByCategoryIds(List<Long> categoryIds) {
        LambdaQueryWrapper<StyleCategory> queryWrapper = new LambdaQueryWrapper<StyleCategory>()
                .in(StyleCategory::getCategoryId, categoryIds)
                .eq(StyleCategory::getDeleted, DeletedFlag.NOT_DELETED.value);
        return list(queryWrapper);
    }
}
